home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’95 / WelcomeToMacDialogsSuck / WelcomeToMacDialogsSuckReadMe
Text File  |  1995-06-25  |  5KB  |  64 lines

  1. WelcomeToMacDialogsSuck ReadMe
  2. By Randy Thelen
  3. MacHack, 1995
  4.  
  5. This hack allows you to install code resources which run before the System software has initialized: in fact, you can run code before the "Welcome To Macintosh" display is displayed.  To make matters worse, you'll run before Macsbug does.  Becareful, don't ship software that uses this technology, keep disk utilities handy, and Have Fun With It!
  6.  
  7. Caution: Any work done on a System file should _ALWAYS_ be done on a copy of the file.
  8. Caution: Any work done on a System file _MAY_ cause your system to not boot correctly.  Make sure that you are prepared to boot from a floppy or an external drive in the case of a mistake.
  9.  
  10. The boot blocks on a startup disk are, quite literally, a copy of the 'boot' #1 resource in the System file on your disk.  There have been many versions over the years and updating system software should update your boot blocks.  Boot 1 Initializes the File Manager and mounts the boot volume.  Boot 1 then loads boot 2 and runs it.  
  11.  
  12. 'boot' resource #2  loads and executes 'boot' #3.  Boot 2 will load boot 3 from either the System file or from an enabler.  In the case of System 7.5.1, there is the 'System 7.5 Update' enabler file which encompasses all enablers written up to that point.
  13.  
  14. Boot 3 does a lot of work.  Boot 3 displays the 'Welcome To Macintosh' dialog in the absence of a file called "StartUpScreen" (check your boot 1 resource for the exact name of the file -- you can change it in your boot blocks).
  15.  
  16. The hack you are about to install modifies the boot 3 resource.
  17.  
  18. 1.  Bringing up the "Welcome To Macintosh" dialog is done by a call into SysError.  You now need to do:
  19.  (a) duplicate your System 7.5 Update file;
  20.  (b) open the duplicate;
  21.  (c) open the 'boot' resource, only #3 exists -- that's the one;
  22.  (d) go down to byte offset $156.  NOP over the next six bytes (3 words) -- $4E71;
  23.  (e) OK, now over the next two instructions put a 'BSR xxx' ($6100 $2CA8);
  24.  (f) this last BSR should be followed by 'MOVE.L (A7)+,SysMap' ($31DF $0A58).  If that's right, continue; if not there is a problem (potentially with these directions  ;-)
  25.  (g) OK, now you're done with the first step.
  26. By the way, if you change the step (e) to NOP NOP then you can reboot your system just fine (empty the trash; throw away your System 7.5 Update; rename your update copy to not include the ' copy' characters (duh!)) -- reboot!
  27.  
  28. But it leaves the screen grey.  No smiley face, no nothin'.  Just grey.
  29.  
  30. OK, so I wrote some code, the source you've also got, which you can put at the _END_ of boot 3 (in the System 7.5 Update file) and then you can put a BSR from where the last two NOPs are.
  31.  
  32. 2.  Installing the second half of the hack:
  33.  (a) Again, make a copy of System 7.5 Update.
  34.  (b) Open the 'Boot3Init' file inside of the Part 2 folder.
  35.  (c) Select all.  Copy.  This copies the bytes from the 'boot' resource.  
  36.  (d) Open the duplicate System 7.5 Update file.
  37.  (e) Open the 'boot' #3 resource.
  38.  (f) Go to the very end.
  39.  (h) Paste all of the bytes you copied from the 'boot' resource.  Notice the first instruction is an RTS.  Becareful, ... instruction placement is very important to the computer.  Copy all the bytes as you copied them.
  40.  (i) Go down to byte offset $15C.  You should now have either (1) 5 NOPs in a row or (2) 3 NOPs and a BSR, depending on a previous step.
  41.  (j) If necessary, change the last two NOPs to a Branch instruction -- BSR ($6100 $2CA8).  
  42.  
  43. -- Now, we're going to disassemble all this code:
  44.  (a) Select all. Copy.
  45.  (b) Create new resource (command K), 'WDEF'.
  46.  (c) Paste the data into the Hex editor for your WDEF.  
  47.  (d) Click on the Code Editor for the WDEF.  (You DO have the code editor installed, right?  Check your ResEdit supplier, it comes free from Apple.)
  48.  (e) Look at the code at offset 156.  Does it look right?
  49.  (f) Follow the BSR instruction.  Does it go to valid code?  The entry point for the function __Startup__
  50. The code you just inserted is the key:  it will read all of the 'b3++' resource types in the System file (or the System 7.5 Update file) and execute them one at a time.  These code resources are executed before the system is installed: System 7 is NOT installed when these code resources execute!  MacsBug is NOT installed when these code resources run!  Use very few and very specific services in these code resources.  Also, if you hold the mouse button down, the code won't run.
  51.  
  52. Last, In part 3 is a sample part.  Copy the PICT & 'b3++' resources.  Paste them into your copy of the System 7.5 Update file.  Save.
  53. Empty the trash.  
  54. Move System 7.5 Update into the trash.
  55. Rename the System 7.5 Update copy to System 7.5 Update.
  56. Restart your computer.
  57.  
  58. Did I remind you to have a disk tools nearby ...  Yea, you'll want one.  If all else fails, remove the Update file from your system folder and reboot.  That should help.  If the 'b3++' code fails, you can hold down the mouse key at boot time to force it to not run.
  59.  
  60. Good luck!  Have fun!
  61.  
  62. --Randy Thelen
  63. random@apple.com
  64. RANDOM at AppleLink